using Google.ProtocolBuffers;
using Google.ProtocolBuffers.Collections;
using micromsgBackground.Proto;
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Runtime.CompilerServices;
namespace micromsgBackground
{
	[GeneratedCode("ProtoGen", "2.3.0.277"), DebuggerNonUserCode, CompilerGenerated]
	public sealed class SyncKey : GeneratedMessageLite<SyncKey, SyncKey.Builder>
	{
		[GeneratedCode("ProtoGen", "2.3.0.277"), DebuggerNonUserCode, CompilerGenerated]
		public sealed class Builder : GeneratedBuilderLite<SyncKey, SyncKey.Builder>
		{
			private bool resultIsReadOnly;
			private SyncKey result;
			protected override SyncKey.Builder ThisBuilder
			{
				get
				{
					return this;
				}
			}
			public override bool IsInitialized
			{
				get
				{
					return this.result.IsInitialized;
				}
			}
			protected override SyncKey MessageBeingBuilt
			{
				get
				{
					return this.PrepareBuilder();
				}
			}
			public override SyncKey DefaultInstanceForType
			{
				get
				{
					return SyncKey.DefaultInstance;
				}
			}
			public uint KeyNum
			{
				get
				{
					return this.result.KeyNum;
				}
				set
				{
					this.SetKeyNum(value);
				}
			}
			public IPopsicleList<KeyVal> KeyList
			{
				get
				{
					return this.PrepareBuilder().key_;
				}
			}
			public int KeyCount
			{
				get
				{
					return this.result.KeyCount;
				}
			}
			public Builder()
			{
				this.result = SyncKey.DefaultInstance;
				this.resultIsReadOnly = true;
			}
			internal Builder(SyncKey cloneFrom)
			{
				this.result = cloneFrom;
				this.resultIsReadOnly = true;
			}
			private SyncKey PrepareBuilder()
			{
				if (this.resultIsReadOnly)
				{
					SyncKey other = this.result;
					this.result = new SyncKey();
					this.resultIsReadOnly = false;
					this.MergeFrom(other);
				}
				return this.result;
			}
			public override SyncKey.Builder Clear()
			{
				this.result = SyncKey.DefaultInstance;
				this.resultIsReadOnly = true;
				return this;
			}
			public override SyncKey.Builder Clone()
			{
				if (this.resultIsReadOnly)
				{
					return new SyncKey.Builder(this.result);
				}
				return new SyncKey.Builder().MergeFrom(this.result);
			}
			public override SyncKey BuildPartial()
			{
				if (this.resultIsReadOnly)
				{
					return this.result;
				}
				this.resultIsReadOnly = true;
				return this.result.MakeReadOnly();
			}
			public override SyncKey.Builder MergeFrom(IMessageLite other)
			{
				if (other is SyncKey)
				{
					return this.MergeFrom((SyncKey)other);
				}
				base.MergeFrom(other);
				return this;
			}
			public override SyncKey.Builder MergeFrom(SyncKey other)
			{
				return this;
			}
			public override SyncKey.Builder MergeFrom(ICodedInputStream input)
			{
				return this.MergeFrom(input, ExtensionRegistry.Empty);
			}
			public override SyncKey.Builder MergeFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry)
			{
				this.PrepareBuilder();
				uint num;
				string text;
				while (input.ReadTag(out num, out text))
				{
					if (num == 0u && text != null)
					{
						int num2 = Array.BinarySearch<string>(SyncKey._syncKeyFieldNames, text, StringComparer.get_Ordinal());
						if (num2 < 0)
						{
							this.ParseUnknownField(input, extensionRegistry, num, text);
							continue;
						}
						num = SyncKey._syncKeyFieldTags[num2];
					}
					uint num3 = num;
					if (num3 == 0u)
					{
						throw InvalidProtocolBufferException.InvalidTag();
					}
					if (num3 != 8u)
					{
						if (num3 != 18u)
						{
							if (WireFormat.IsEndGroupTag(num))
							{
								return this;
							}
							this.ParseUnknownField(input, extensionRegistry, num, text);
						}
						else
						{
							input.ReadMessageArray<KeyVal>(num, text, this.result.key_, KeyVal.DefaultInstance, extensionRegistry);
						}
					}
					else
					{
						this.result.hasKeyNum = input.ReadUInt32(ref this.result.keyNum_);
					}
				}
				return this;
			}
			public SyncKey.Builder SetKeyNum(uint value)
			{
				this.PrepareBuilder();
				this.result.hasKeyNum = true;
				this.result.keyNum_ = value;
				return this;
			}
			public SyncKey.Builder ClearKeyNum()
			{
				this.PrepareBuilder();
				this.result.hasKeyNum = false;
				this.result.keyNum_ = 0u;
				return this;
			}
			public KeyVal GetKey(int index)
			{
				return this.result.GetKey(index);
			}
			public SyncKey.Builder SetKey(int index, KeyVal value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				this.result.key_[index] = value;
				return this;
			}
			public SyncKey.Builder SetKey(int index, KeyVal.Builder builderForValue)
			{
				ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
				this.PrepareBuilder();
				this.result.key_[index] = builderForValue.Build();
				return this;
			}
			public SyncKey.Builder AddKey(KeyVal value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				this.result.key_.Add(value);
				return this;
			}
			public SyncKey.Builder AddKey(KeyVal.Builder builderForValue)
			{
				ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
				this.PrepareBuilder();
				this.result.key_.Add(builderForValue.Build());
				return this;
			}
			public SyncKey.Builder AddRangeKey(IEnumerable<KeyVal> values)
			{
				this.PrepareBuilder();
				this.result.key_.Add(values);
				return this;
			}
			public SyncKey.Builder ClearKey()
			{
				this.PrepareBuilder();
				this.result.key_.Clear();
				return this;
			}
		}
		public const int KeyNumFieldNumber = 1;
		public const int KeyFieldNumber = 2;
		private static readonly SyncKey defaultInstance;
		private static readonly string[] _syncKeyFieldNames;
		private static readonly uint[] _syncKeyFieldTags;
		private bool hasKeyNum;
		private uint keyNum_;
		private PopsicleList<KeyVal> key_ = new PopsicleList<KeyVal>();
		private int memoizedSerializedSize = -1;
		public static SyncKey DefaultInstance
		{
			get
			{
				return SyncKey.defaultInstance;
			}
		}
		public override SyncKey DefaultInstanceForType
		{
			get
			{
				return SyncKey.DefaultInstance;
			}
		}
		protected override SyncKey ThisMessage
		{
			get
			{
				return this;
			}
		}
		public uint KeyNum
		{
			get
			{
				return this.keyNum_;
			}
		}
		public IList<KeyVal> KeyList
		{
			get
			{
				return this.key_;
			}
		}
		public int KeyCount
		{
			get
			{
				return this.key_.Count;
			}
		}
		public override bool IsInitialized
		{
			get
			{
				if (!this.hasKeyNum)
				{
					return false;
				}
				bool result;
				using (IEnumerator<KeyVal> enumerator = this.KeyList.GetEnumerator())
				{
					while (enumerator.MoveNext())
					{
						KeyVal current = enumerator.get_Current();
						if (!current.IsInitialized)
						{
							result = false;
							return result;
						}
					}
					return true;
				}
				return result;
			}
		}
		public override int SerializedSize
		{
			get
			{
				int num = this.memoizedSerializedSize;
				if (num != -1)
				{
					return num;
				}
				num = 0;
				if (this.hasKeyNum)
				{
					num += CodedOutputStream.ComputeUInt32Size(1, this.KeyNum);
				}
				using (IEnumerator<KeyVal> enumerator = this.KeyList.GetEnumerator())
				{
					while (enumerator.MoveNext())
					{
						KeyVal current = enumerator.get_Current();
						num += CodedOutputStream.ComputeMessageSize(2, current);
					}
				}
				this.memoizedSerializedSize = num;
				return num;
			}
		}
		private SyncKey()
		{
		}
		public KeyVal GetKey(int index)
		{
			return this.key_[index];
		}
		public override void WriteTo(ICodedOutputStream output)
		{
			int arg_06_0 = this.SerializedSize;
			string[] syncKeyFieldNames = SyncKey._syncKeyFieldNames;
			if (this.hasKeyNum)
			{
				output.WriteUInt32(1, syncKeyFieldNames[1], this.KeyNum);
			}
			if (this.key_.Count > 0)
			{
				output.WriteMessageArray<KeyVal>(2, syncKeyFieldNames[0], this.key_);
			}
		}
		public override int GetHashCode()
		{
			int num = base.GetType().GetHashCode();
			if (this.hasKeyNum)
			{
				num ^= this.keyNum_.GetHashCode();
			}
			using (IEnumerator<KeyVal> enumerator = this.key_.GetEnumerator())
			{
				while (enumerator.MoveNext())
				{
					KeyVal current = enumerator.get_Current();
					num ^= current.GetHashCode();
				}
			}
			return num;
		}
		public override bool Equals(object value)
		{
			SyncKey syncKey = value as SyncKey;
			if (syncKey == null)
			{
				return false;
			}
			if (this.hasKeyNum != syncKey.hasKeyNum || (this.hasKeyNum && !this.keyNum_.Equals(syncKey.keyNum_)))
			{
				return false;
			}
			if (this.key_.Count != syncKey.key_.Count)
			{
				return false;
			}
			for (int i = 0; i < this.key_.Count; i++)
			{
				if (!this.key_[i].Equals(syncKey.key_[i]))
				{
					return false;
				}
			}
			return true;
		}
		public override void PrintTo(TextWriter writer)
		{
			GeneratedMessageLite<SyncKey, SyncKey.Builder>.PrintField("KeyNum", this.hasKeyNum, this.keyNum_, writer);
			GeneratedMessageLite<SyncKey, SyncKey.Builder>.PrintField<KeyVal>("Key", this.key_, writer);
		}
		public static SyncKey ParseFrom(byte[] data)
		{
			return SyncKey.CreateBuilder().MergeFrom(data).BuildParsed();
		}
		private SyncKey MakeReadOnly()
		{
			this.key_.MakeReadOnly();
			return this;
		}
		public static SyncKey.Builder CreateBuilder()
		{
			return new SyncKey.Builder();
		}
		public override SyncKey.Builder ToBuilder()
		{
			return SyncKey.CreateBuilder(this);
		}
		public override SyncKey.Builder CreateBuilderForType()
		{
			return new SyncKey.Builder();
		}
		public static SyncKey.Builder CreateBuilder(SyncKey prototype)
		{
			return new SyncKey.Builder(prototype);
		}
		static SyncKey()
		{
			SyncKey.defaultInstance = new SyncKey().MakeReadOnly();
			SyncKey._syncKeyFieldNames = new string[]
			{
				"Key",
				"KeyNum"
			};
			SyncKey._syncKeyFieldTags = new uint[]
			{
				18u,
				8u
			};
			object.ReferenceEquals(micromsgBackground.Proto.SyncKey.Descriptor, null);
		}
	}
}
